import request from '@/config/axios'

export interface CollegeVO {
  id: number
  collegeName: string
  collegeCode: string
  schoolId: number
}

// 查询机构分页
export const getCollegePage = async (params) => {
  return await request.get({ url: `/cmis/college/page`, params })
}

// 查询机构列表
export const getCollegeList = async (params) => {
  return await request.get({ url: `/cmis/college/list`, params })
}

// 查询机构列表
export const queryCollegeList = async (params) => {
  return await request.get({ url: `/cmis/college/query`, params })
}

// 查询机构详情
export const getCollege = async (id: number) => {
  return await request.get({ url: `/cmis/college/get?id=` + id })
}

// 新增机构
export const createCollege = async (data: CollegeVO) => {
  return await request.post({ url: `/cmis/college/create`, data })
}

// 修改机构
export const updateCollege = async (data: CollegeVO) => {
  return await request.put({ url: `/cmis/college/update`, data })
}

// 删除机构
export const deleteCollege = async (id: number) => {
  return await request.delete({ url: `/cmis/college/delete?id=` + id })
}

// 导出机构 Excel
export const exportCollege = async (params) => {
  return await request.download({ url: `/cmis/college/export-excel`, params })
}

// 批量删除学院
export const batchDeleteCollege = async (ids: Array<string>) => {
  return await request.delete({ url: `/cmis/college/batchDelete?ids=` + ids })
}
